<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>BFC</title>
		<style>
			.box1 {
				width: 100px;
				height: 100px;
				margin: 100px;
				background-color: red;
			}

			.box2 {
				width: 100px;
				height: 100px;
				margin: 100px;
				background-color: green;
			}

			.bfc {
				overflow: hidden;
			}
		</style>
	</head>

	<body>
		<div class="bfc">
			<div class="box1"></div>
			<div class="box1"></div>
		</div>
		<div class="bfc">
			<div class="box2"></div>
		</div>
	</body>

</html>
